{% extends "base.html" %}
{% block media %}
<script type="text/javascript">
$(document).ready(function(){ 
	var msg = "{{ msg }}";
	if (msg != ""){
		alert(msg);
	}
	$("form[action='#']").submit(function(){
		if($("input[name='name']").val()==''){
			alert('姓名不能为空!');
			return false;
		}else if($("input[name='number']").val()==''){
			alert('手机号码不能为空!');
			return false;
		}else if($("input[name='city']").val()==''){
			alert('城市拼音不能为空!');
			return false;
		}else{
			return true;
		}
		return false;
	});
	$("#quickSend").click(function(){
		window.location.href = '/admin/quickSend';
//		$.ajax({ url: "",success: function(){
//			    alert('短信已发送!');
//		}});
	});
});
</script>
{% endblock media%}
{% block left %}
<h2>新增用户</h2>
<form action="#" method="post">
<table>
	<tr>
		<td>
			姓名
		</td>
		<td><input type="text" name="name"/></td>
	</tr>
	<tr>
		<td>
			手机号
		</td>
		<td><input type="text" name="number"/></td>
	</tr>
	<tr>
		<td>
			城市
		</td>
		<td>
			<select name="city">
				{% for c in citys %}
				<option value="{{ c.key }}">{{ c.name }}</option>
				{% endfor %}
			</select>
		</td>
	</tr>
	<tr>
		<td></td>
		<td><input type="submit" value="新增"/> </td>
	</tr>
</table>
</form>
{% endblock left %}
{% block right %}
<h2>发送列表</h2>
<form action="/admin/deletesenders" method="post">
<table>
	<tr>
		<td>
			<select name="list" multiple style="height:200px;width:200px;">
				{% if list %}
				{% for send in list %}
				<option value="{{ send.key }}">{{ send.name }}  {{ send.number }}</option>
				{% endfor %}
				{% endif %}
			</select>
		</td>
		<td>
		</td>
	</tr>
	<tr>
		<td><input type="submit" value="删除"/> <input id="quickSend" type="button" value="立刻发送"/></td>
		<td></td>
	</tr>
</table>
</form>
{% endblock right %}
